package com.linghang.wusthelpercompetition.service;

import com.linghang.wusthelpercompetition.dto.CompetitionDTO;
import com.linghang.wusthelpercompetition.dto.CompetitionPostPageDTO;
import com.linghang.wusthelpercompetition.dto.CompetitionPostUpdateDTO;
import com.linghang.wusthelpercompetition.entity.CompetitionPost;
import com.linghang.wusthelpercompetition.result.PageResult;

import java.util.List;


public interface CompetitionPostService {

    /**
     * 新建一个帖子
     * @param competitionDTO
     */
    void save(CompetitionDTO competitionDTO);

    /**
     * 删除一个帖子
     * @param cid
     */
    void deleteByCid(long cid);

    /**
     * 更新一个帖子
     * @param competitionPostUpdateDTO
     */
    void update(CompetitionPostUpdateDTO competitionPostUpdateDTO);

    /**
     * 分页查询帖子
     * @param competitionPostPageDTO
     * @return
     */
    PageResult pageQuery(CompetitionPostPageDTO competitionPostPageDTO);

    /**
     * 根据cid查询帖子信息
     * @param cid
     * @return
     */
    CompetitionPost getByCid(Long cid);

    /**
     * 帖子超时15天自动删除
     */
    void timeoutPost();

    List<CompetitionPost> selectBycids(List<Long> cids);

    Long getTotalByStudentId(String studentId);
}
